home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 011-020 / amok18 / popup-menu / pop.def < prev    next >
Text File  |  1993-11-04  |  2KB  |  77 lines

  1. (*---------------------------------------------------------------------------
  2.    :Program.    PopUp-Module
  3.    :Version.    2.01 as Modula-2 modules pop.def and pop.mod.
  4.    :Contants.   Usage of Amiga PopUp menus.
  5.    :Remark.     Works similar to Intuition menus.
  6.    :History.    V1.0, pop.c by Derek Zahn,
  7.    :History.                   (Gambit Software, Madison WI) July 1987
  8.    :History.    V2.0,  1:1  conversion to Modula-2 and
  9.    :History.    V2.01, rectified and slightly improved version by
  10.    :Author.     Jochen P. Kupfer,
  11.    :Address.    Buchenweg 22, D-4006 Erkrath 2, West-Germany,
  12.    :Phone.      2104-40673
  13.    :Group.      SIGMA (Special Interest Group Modula-2 Amiga)
  14.    :Date.       4/16-Feb-89
  15.    :Copyright.  PD
  16.    :Language.   Modula-2
  17.    :Translator. M2Amiga V3.2d
  18. ---------------------------------------------------------------------------*)
  19.  
  20.  
  21. DEFINITION MODULE pop;
  22.  
  23. FROM Intuition IMPORT WindowPtr, MenuPtr, MenuItemPtr;
  24. FROM SYSTEM    IMPORT ADDRESS;
  25.  
  26.  
  27. TYPE
  28.  popFlags = (menuEnabled,popVerify,popRelease,popTidy,popPointRel,popWinRel,
  29.              popRemember,popUsed,pf8,popMovePointer,pf10,pf11,
  30.              popLeftButton,popRightButton,popTriggerDown,popTriggerUp);
  31.  popFlagSet = SET OF popFlags;
  32.  
  33. CONST
  34.   PopTitleHeight = 10; (* If you use bigger fonts in the Screen-RECORD
  35.                           change it to 'ySize+2'. *)
  36.  
  37. TYPE
  38.   popMenuPtr = POINTER TO popMenu;
  39.  
  40.   popMenu     = RECORD
  41.      nextMenu :popMenuPtr; (* Not yet used, if you like to implement...!*)
  42.      leftEdge :INTEGER;
  43.       topEdge :INTEGER;
  44.         width :INTEGER;
  45.        height :INTEGER;
  46.         flags :popFlagSet;
  47.      menuName :ADDRESS;
  48.     firstItem :MenuItemPtr;
  49.   END;
  50.  
  51.  
  52.  
  53. (*
  54.  * PopChoose(menPtr, winPtr)
  55.  * menPtr -- pointer to the menu to pop
  56.  * winPtr -- the window to which this menu relates.
  57.  *           NIL is not allowed, since I don't see any use for a
  58.  *           PopUpWindow for a window which is not open!
  59.  *
  60.  * This function provides a blocking pop-up menu.  It returns -1 if
  61.  * either an error occurred attempting to pop or if no selection was made
  62.  * by the user.  If a selection was made, a number between 0 and n-1 is
  63.  * returned, where n is the number of MenuItems.
  64.  *
  65.  * -1 is also returned if a selection of a checked item was made.
  66.  *
  67.  * Since this code opens a window, it is up to the caller to be sure that
  68.  * no scribbling in droll ways is done while this code is in progress.
  69.  *)
  70.  
  71.  
  72. PROCEDURE PopChoose(menPtr:popMenuPtr;winPtr:WindowPtr):LONGINT;
  73.  
  74.  
  75. END pop.def
  76.  
  77.